package conceptmaniax.hotelapp.util.sync;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.http.HttpEntity;

public class CustomHttpEntity extends org.apache.http.entity.HttpEntityWrapper {
	
	private OutputStreamProgress outstream;
	private WriteListener writeListener;
	
	public CustomHttpEntity(HttpEntity wrapped) {
		super(wrapped);
	}

	public void setWriteListener(WriteListener writeListener) {
		this.writeListener = writeListener;
	}

	@Override
	public void writeTo(OutputStream outstream) throws IOException {	
		this.outstream = new OutputStreamProgress(outstream, writeListener);
		super.writeTo(this.outstream);
	}
}
